package com.tbit.main.service.impl;

import com.tbit.main.constant.DaoParamConstant;
import com.tbit.main.dao.log.ParkBorrowLogDao;
import com.tbit.main.pojo.ParkBorrowGroup;
import com.tbit.main.service.ParkBorrowLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Service("parkBorrowLogService")
public class ParkBorrowLogServiceImpl implements ParkBorrowLogService {
    @Autowired
    private ParkBorrowLogDao parkBorrowLogDao;

    @Override
    public List<ParkBorrowGroup> groupRendByTime(Integer accountId, String startTime, String endTime) {
        Map<String, Object> params = new HashMap<String, Object>();
        params.put(DaoParamConstant.accountId, accountId);
        params.put(DaoParamConstant.startTime, startTime);
        params.put(DaoParamConstant.endTime, endTime);

        return parkBorrowLogDao.groupRendByTime(params);
    }

    @Override
    public List<ParkBorrowGroup> groupReturnByTime(Integer accountId, String startTime, String endTime) {
        Map<String, Object> params = new HashMap<String, Object>();
        params.put(DaoParamConstant.accountId, accountId);
        params.put(DaoParamConstant.startTime, startTime);
        params.put(DaoParamConstant.endTime, endTime);

        return parkBorrowLogDao.groupReturnByTime(params);
    }

}  